<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>{BEESCRM:$title}</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/base/busbooking/css/mobiscroll.custom-3.0.0-beta2.min.css">
    <link rel="stylesheet" href="/assets/base/busbooking/css/style.css">
    <link rel="stylesheet" href="/assets/base/busbooking/css/layer.css">
</head>
<body>
<div class="wraper">
    <div class="header ">
        <div class="flex-between">
            <a href="javascript:history.go(-1)" class="iconfont icon-llmainpageback "></a>

            <div class="title text-center font-16">公交专线购票</div>
            <a href="#" class="iconfont icon-saomiao-copy "></a>
        </div>
        <div class="head-img">
            <img src="{BEESCRM:$userimg}" alt="">
        </div>
        <div class="text-center">
            <if condition="$type eq 2"> 已使用
                <elseif condition="$type eq 3"/>
                已过期
                <elseif condition="$type eq 5"/>
                非本车次车票
                <elseif condition="$type eq 4"/>
                待检票
            </if>
        </div>
    </div>
    <div class="box flex-between margin-t12">
        <div class="gray">
            <span class="iconfont icon-checichaxun"></span>
            <span>当前检查车次：</span>
            <span class="gray2">{BEESCRM:$last_time} </span>
        </div>
        <a href="/Base/BusBookingCheck/ticketschecked/apply_id/{BEESCRM:$applyId}/order_id/{BEESCRM:$orderinfo['order_id']}/flag/1"
           class="gray iconfont icon-chevron-copy-copy-copy-copy-copy-copy"></a>
    </div>
    <div class="address text-center">
        <div class="time font-12">
            20{BEESCRM:$orderinfo.check_time|date="y-m-d",###}&nbsp;{BEESCRM:$orderinfo['departure_time']}开车
        </div>
        <div class="flex-between Campus font-16">
            <div>{BEESCRM:$orderinfo.start_address}</div>
            <div class="arrows"><img src="/assets/base/busbooking/images/jiantou.png" alt=""></div>
            <div>{BEESCRM:$orderinfo.end_address}</div>
        </div>
    </div>
    <div class="box flex-between margin-t12">
        <div class="gray">
            乘车地点：
        </div>
        <div class="gray2">{BEESCRM:$classadd}</div>
    </div>
    <div class="box flex-between margin-t12">
        <div class="gray">
            票价：
        </div>
        <div class="gray2 font-16">{BEESCRM:$orderinfo.order_amount}</div>
        <input type="hidden" id="order_id" value="{BEESCRM:$orderinfo['order_id']}">
    </div>
    <if condition="$type eq 4">
        <a href="#" class="btn text-center font-16 demand">确定检票</a>
    </if>
</div>
</body>
<script src="/assets/base/busbooking/js/jquery-2.1.0.min.js"></script>
<script src="/assets/base/busbooking/js/layer.js"></script>
<script src="/assets/base/busbooking/js/public.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<include file="share_header" /><!--wx.config配置-->
<script>
    $('.btn').click(function () {
        data = {};
        data.order_id =$('#order_id').val();
        $.ajax({
            data: data,
            type: 'POST',
            dataType: 'json',
            url: '/Base/BusBookingCheck/OrderYes/apply_id/{BEESCRM:$applyId}',
            success: function (result) {
                if (result.status == 'S') {
                    //fm.alert('上传成功');
                    window.location.href = "/Base/BusBookingCheck/checkSuccess/apply_id/{BEESCRM:$apply_id}";
                } else {
                    fm.alert('操作失败');
                    reload();
                }
            }
        })
    })
    //调起二维码扫一扫
    $(document).ready(function(){
        $(document).on('click','.icon-saomiao-copy',function(){
            wx.scanQRCode({
                needResult: 0, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
                scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
                success: function (res) {
                    var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
                }
            });
        });
    })
    function reload() {
        setTimeout('location.reload()', 2000);
    }
</script>
</html>